#include<iostream>
using namespace std;
#include<fstream>
#include<cmath>

int main(){

	int i, j, n=1000, Nt = 10000;
	int * walker = new int [n];
	for(i=0;i<n;i++){
		walker[i] = -1;// -1/1 for left/right
	}
	int count[2]={1000,0};
	ofstream fp("mc_gas.txt");
	for(j=1;j<=Nt;j++){
		i = rand() % n ;
		walker[i] *= -1;
		if( walker[i] == 1 ){
			count[1] ++; count[0] --;
		}
		else{
			count[0] ++; count[1] --;
		}
		fp<<j<<"\t"<<count[0]<<"\t"<<count[1]<<endl;
	}
	fp.close();
	return 0;
}
